package main
import "fmt"

type stu struct{
	name string
	age int
}

type student struct{
	stu
	id int
}

func (s stu)ceshi(){
	fmt.Printf("name = %s\tage = %d\n", s.name, s.age)
}

func (s student)ceshi(){
	fmt.Printf("name = %s\tage = %d\tid = %d\n", s.name, s.age, s.id)
}

func main(){
	var a stu
	a.name = "RuiGe"
	a.age = 22
	a.ceshi()
	
	fmt.Println("=============访问重写后的方法=============")
	var b student
	b.name = "瑞哥"
	b.age = 22
	b.id = 20180803
	b.ceshi()
	
	fmt.Println("=============访问重写前的方法=============")
	b.stu.ceshi()
	
}
